package cn.ffcs.bpmpvc.web;

import java.io.File;
import java.io.OutputStream;
import java.net.URLEncoder;
import java.text.ParseException;
import java.util.Date;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import jxl.Workbook;
import jxl.format.Alignment;
import jxl.format.CellFormat;
import jxl.format.Colour;
import jxl.write.Label;
import jxl.write.WritableCellFormat;
import jxl.write.WritableFont;
import jxl.write.WritableSheet;
import jxl.write.WritableWorkbook;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;

import org.apache.commons.lang.StringUtils;
import org.echoice.paper.PageBean;
import org.echoice.paper.PageNavi;
import org.echoice.util.DateUtil;

import cn.ffcs.bpm.model.ProcTranRecord;
import cn.ffcs.bpm.model.TransactProcessStatus;
import cn.ffcs.bpmpvc.graph.Node;
import cn.ffcs.bpmpvc.model.PocReqPlan;
import cn.ffcs.bpmpvc.services.AppBusinessReqService;
import cn.ffcs.bpmpvc.services.bean.ConfigBean;
import cn.ffcs.bpmpvc.svc.ProcessPvcService;
import cn.ffcs.bpmpvc.svc.TaskAssignBean;
import cn.ffcs.bpmpvc.svc.TaskService;
import cn.ffcs.bpmpvc.web.forms.FlowTaskForm;
import cn.ffcs.bpmpvc.web.views.FlowTaskObjView;
import cn.ffcs.bpmpvc.web.views.ProcessInstView;
import cn.ffcs.bpmpvc.web.views.ProcessView;
import cn.ffcs.bpmpvc.web.views.TaskView;
import cn.ffcs.businessrequest.model.BusinessReason;
import cn.ffcs.businessrequest.model.BusinessRequest;
import cn.ffcs.businessrequest.model.ProdAdvReq;
import cn.ffcs.businessrequest.model.ReqDelay;
import cn.ffcs.businessrequest.model.ReqDocu;
import cn.ffcs.businessrequest.model.ReqProgress;
import cn.ffcs.organ.model.Person;
import cn.ffcs.security.model.User;
import cn.ffcs.system.dict.model.Dict;
import cn.ffcs.util.context.ApplicationContextUtil;

public class FlowBusinessRequestAction extends FlowAppBaseAction<TransactProcessStatus> {
	/**
	 * newBusinessReq
	 */
	private static final long serialVersionUID = 1L;
	private static final String JUMP_MSG = "jumpMsg";
	private ProcessPvcService processPvcService;
	private TaskService taskService;
	private AppBusinessReqService appBusinessReqService;
	private ProdAdvReq prodAdvReq;
	private BusinessRequest businessRequest;
	private ConfigBean configBean;
	/** 需求类型 * */
	private List<Dict> types;
	/** 重要性 * */
	private List<Dict> importances;

	/** 附件上传 * */
	private List<File> uploads;
	private List<String> filetype;
	/** 要删除的文件* */
	private List<String> delDocumentIds;

	/** 需求进展数据 * */
	private ReqProgress reqProgress;

	/** 需求延迟 * */
	private ReqDelay reqDelay;

	private String flowTaskId;
	private String processId;
	private Integer procinstId;
	private String str_procinstId;
	private FlowTaskForm flowTaskForm;
	/**
	 * 新产品开发
	 * @return
	 */
	public String applyInit() {
		initDict();
		businessRequest = new BusinessRequest();		
		String processId = getAppBusinessReqService().getFlowNewReqProcessId();
		ProcessView processView = getProcessPvcService().getInitProcessInfo(processId);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("processView", processView);
		businessRequest.setImportance("一般");
		// 得到产品经理角色用户

		List<Person> prodList = appBusinessReqService.findProdListByRole();
		ApplicationContextUtil.getHttpServletRequest().setAttribute("prodList", prodList);
		return "initApply";
	}	
	/**
	 * 新产品开发需求发起保存
	 * @return
	 */
	public String saveStartFlow() {
		String isCommitS = ApplicationContextUtil.getContextObject("isCommit");
		String advanTime = ApplicationContextUtil.getContextObject("businessRequest.advanTime");
		if (StringUtils.isNotBlank(advanTime)) {
			try {
				businessRequest.setAdvanTime(DateUtil.parse(advanTime, "yyyy-MM-dd"));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}
		boolean isCommit = Boolean.valueOf(isCommitS);
		User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		List<TaskAssignBean> nextTasksList = getNextTaskUserList(req);
		if(StringUtils.isBlank(businessRequest.getProcinstType())){
			businessRequest.setProcinstType("01");
		}
		businessRequest.setEnd(cn.ffcs.util.converter.DateUtil.getMaxDate());
		businessRequest.replaceContentNtoBR();
		setStartFlowMsg(isCommit);
		try {
			//String processId = getAppBusinessReqService().getFlowNewReqProcessId();
			String processId =req.getParameter("processId");
			@SuppressWarnings("unused")
			ProcTranRecord procTranRecord = getAppBusinessReqService().saveBusinessReqAndStartFlow(processId, user.getPerson(), nextTasksList, isCommit, businessRequest, uploads, filetype);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			returnMsg = e.getMessage();
		}
		return JUMP_MSG;
	}
	/**
	 * 查看明细 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String showDetail() {
		businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procinstId);
		if("03".equals(businessRequest.getProcinstType())){
			initReqDict();
		}else{
			initDict();
		}
		String toPage = ApplicationContextUtil.getContextObject("toPage");
		String isCondition = ApplicationContextUtil.getContextObject("isCondition");
		TaskView taskView = null;
		if ("true".equals(isCondition)) {
			taskView = getTaskService().getTaskView(flowTaskId, businessRequest.getProjectApply(),null);
		} else {
			taskView = getTaskService().getTaskView(flowTaskId);
		}

		ApplicationContextUtil.getHttpServletRequest().setAttribute("taskView", taskView);

		// 取业务数据
		// Integer procInstId=taskView.getProcTranRecord().getProcinstId();

		// 取得任务进展信息、取得任务延迟信息
		getAppBusinessReqService().getReqProgressAndDelay(businessRequest, taskView.getFlowTaskList());

		// 取得已经上传文档
		List<ReqDocu> reqDocuList = getAppBusinessReqService().getAppBusinessReqDao().findDocuList(procinstId);

		ApplicationContextUtil.getHttpServletRequest().setAttribute("reqDocuList", reqDocuList);

		// 判断该步骤是否已上传文档start
		judgeDocuIsUpload(taskView, reqDocuList);

		setRepDocTableStyleList(reqDocuList);

		// 取得需求单延迟信息
		List<PocReqPlan> reqPlanList = getAppBusinessReqService().getPocReqPlanDao().findList(businessRequest.getId().toString());
		ApplicationContextUtil.getHttpServletRequest().setAttribute("reqPlanList", reqPlanList);
		
		
		// 当为优化需求流程时，取得审核前记录
		findProdCheckTaskList();
		// 对于传阅
		String taskType = taskView.getProcTranRecord().getTaskType();
		if ("03".equalsIgnoreCase(taskType)) {
			return "detailForRedo";
		}

		if (StringUtils.isNotBlank(toPage)) {
			if ("bsReqDetailStart".equals(toPage)||"bsFastReqDetailStart".equals(toPage)) {
				// 得到产品经理角色用户
				businessRequest.replaceContentBRtoN();
				List<Person> prodList = appBusinessReqService.findProdListByRole();
				ApplicationContextUtil.getHttpServletRequest().setAttribute("prodList", prodList);
			}
			return toPage;
		}
		return "detail";
	}

	@SuppressWarnings("unchecked")
	private List findProdCheckTaskList() {
		// 当为优化需求流程时，取得审核前记录
		String reqId = businessRequest.getId().toString();
		if ("02".equals(businessRequest.getProcinstType())) {
			ProdAdvReq prodAdvReq = getAppBusinessReqService().getAppBusinessReqDao().getProdAdvReq(reqId, "QD");
			if (prodAdvReq != null) {
				if (prodAdvReq.getProcinstId() != null) {
					List prodAdvChecklist = getTaskService().getFlowPvcDao().findTaskList(prodAdvReq.getProcinstId());
					ApplicationContextUtil.getHttpServletRequest().setAttribute("prodAdvChecklist", prodAdvChecklist);
					return prodAdvChecklist;
				}
			}
		}
		return null;
	}

	/**
	 * 查看详细
	 * 
	 * @return
	 */
	public String showInfo() {
		// 取业务数据
		Integer procInstId = 0;
		String procInstIdS = ApplicationContextUtil.getContextObject("procinstId");

		if (StringUtils.isNotBlank(procInstIdS)) {
			procInstId = Integer.valueOf(procInstIdS);
			businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procInstId);
		} else {
			String reqIdS = ApplicationContextUtil.getContextObject("reqId");
			businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequestById(Integer.valueOf(reqIdS));
			procInstId = businessRequest.getProcinstId();
		}
		procinstId = procInstId;

		// 取得已经上传文档
		List<ReqDocu> reqDocuList = getAppBusinessReqService().getAppBusinessReqDao().findDocuList(procInstId);
		setRepDocTableStyleList(reqDocuList);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("reqDocuList", reqDocuList);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("procInstIdS", procInstId);
		// 取得流程实例及任务信息
		ProcessInstView processInstView = getProcessPvcService().getProcessInstView(procInstId);
		// 取得任务进展信息、取得任务延迟信息
		getAppBusinessReqService().getReqProgressAndDelay(businessRequest, processInstView.getFlowTaskList());
		
		ApplicationContextUtil.getHttpServletRequest().setAttribute("taskView", processInstView);

		setProcessInstTaskInfo(getTaskService(), processInstView, procInstIdS);

		//
		User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
		// 判断登入用户是否为产品经理

		int curUserId = user.getPerson().getId();
		int prodUserId = businessRequest.getProdPerson().getId();
		if (curUserId == prodUserId) {
			ApplicationContextUtil.getHttpServletRequest().setAttribute("showDelayBtn", "true");
		}
		// ApplicationContextUtil.getHttpServletRequest().setAttribute("showDelayBtn",
		// "true");
		// 取得需求单延迟信息
		List<PocReqPlan> reqPlanList = getAppBusinessReqService().getPocReqPlanDao().findList(businessRequest.getId().toString());
		ApplicationContextUtil.getHttpServletRequest().setAttribute("reqPlanList", reqPlanList);
		// 当为优化需求流程时，取得审核前记录
		findProdCheckTaskList();
		//取得需求单强制结束原因
		BusinessReason businessReason=getAppBusinessReqService().getAppBusinessReqDao().findBusinessReason(String.valueOf(procinstId));
		ApplicationContextUtil.getHttpServletRequest().setAttribute("businessReason", businessReason);
		
		
		return "appInfoDetail";
	}

    public String exportExcel(){
        //取业务数据
    	Integer procInstId = 0;
		String procInstIdS = ApplicationContextUtil.getContextObject("procinstId");

		if (StringUtils.isNotBlank(procInstIdS)) {
			procInstId = Integer.valueOf(procInstIdS);
			businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procInstId);
		} else {
			String reqIdS = ApplicationContextUtil.getContextObject("reqId");
			businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequestById(Integer.valueOf(reqIdS));
			procInstId = businessRequest.getProcinstId();
		}
		procinstId = procInstId;

		// 取得已经上传文档
		List<ReqDocu> reqDocuList = getAppBusinessReqService().getAppBusinessReqDao().findDocuList(procInstId);
		setRepDocTableStyleList(reqDocuList);
		// 取得流程实例及任务信息
		ProcessInstView processInstView = getProcessPvcService().getProcessInstView(procInstId);
		List<ProcTranRecord> list=findProdCheckTaskList();
		
        try{
        	
        	HttpServletResponse response = ApplicationContextUtil.getHttpServletResponse();
        	response.setContentType("application/stream;charset=UTF-8");
    		response.setHeader("Content-Disposition", "attachment; filename=\""+ URLEncoder.encode(businessRequest.getName()+".xls", "UTF-8") + "\"");
    		OutputStream os = response.getOutputStream();
    		WritableWorkbook workbook = Workbook.createWorkbook(os);
    		WritableSheet sheet = workbook.createSheet("需求单信息", 0);
    		//定义字体信息
    		jxl.write.WritableFont wf = new jxl.write.WritableFont(WritableFont.TIMES,14,WritableFont.BOLD);
    		jxl.write.WritableCellFormat wcfF = new jxl.write.WritableCellFormat(wf); 
    		wcfF.setBackground(jxl.format.Colour.ICE_BLUE);
    		
    		//
    		jxl.write.WritableFont wfc = new jxl.write.WritableFont(WritableFont.TIMES,12); 
    		jxl.write.WritableCellFormat wcfFc = new jxl.write.WritableCellFormat(wfc);
    		
    		jxl.write.WritableCellFormat wcfFh = new jxl.write.WritableCellFormat(wfc);
    		wcfFh.setAlignment(Alignment.RIGHT);
    		
    		
    		jxl.write.WritableFont wfcGrid = new jxl.write.WritableFont(WritableFont.TIMES,12,WritableFont.BOLD,false,jxl.format.UnderlineStyle.NO_UNDERLINE,Colour.RED); 
    		jxl.write.WritableCellFormat wcfFcGrid = new jxl.write.WritableCellFormat(wfcGrid);
    		
    		//sheet.setRowView(0,500);//高
    		sheet.setColumnView(0, 20);//宽
    		sheet.setColumnView(3, 16);//宽
    		
    		sheet.setColumnView(1, 20);//宽
    		sheet.setColumnView(2, 20);//宽
    		sheet.setColumnView(4, 20);//宽
    		sheet.setColumnView(5, 20);//宽
    		sheet.setColumnView(6, 20);//宽
    		sheet.setColumnView(7, 20);//宽
    		//分类一
    		sheet.mergeCells(0, 0, 7, 0);
    		int row=0;
    		Label label = new Label(0, 0, "流程信息",wcfF); //put a label in cell A1, Label(column,row)
    		sheet.addCell(label);
    		row++;
    		
    		writeLabel(sheet,row,"当前流程：",processInstView.getProcessConfig().getName(),wcfFh,wcfFc);
    		row++;
    		//
    		writeLabel(sheet,row, "当前状态：","","当前办理人：","",wcfFh,wcfFc);
    		row++;
    		//
    		String beginTime=DateUtil.format(processInstView.getProcessStatus().getBegin(), "yyyy-MM-dd HH:mm");
    		String endTime="";
    		if(processInstView.getProcessStatus().getEnd()!=null){
    			endTime=DateUtil.format(processInstView.getProcessStatus().getEnd(), "yyyy-MM-dd HH:mm");
    		}
    		writeLabel(sheet,row, "开如时间：",beginTime,"结束时间：",endTime,wcfFh,wcfFc);
    		row++;
    		row++;
    		//分类二
    		sheet.mergeCells(0, row, 7, row);
    		label = new Label(0, row, "基本信息",wcfF); //put a label in cell A1, Label(column,row)
    		sheet.addCell(label);
    		row++;
    		//
    		writeLabel(sheet,row,"名称：",processInstView.getProcessConfig().getName(),wcfFh,wcfFc);
    		row++;
    		//
    		writeLabel(sheet,row, "发 起 人：",businessRequest.getStartPersonObj().getName(),"发起部门：",businessRequest.getStartDeptObj().getFullName(),wcfFh,wcfFc);
    		row++;
    		//
    		writeLabel(sheet,row,"需求单号：",businessRequest.getReqCode(),wcfFh,wcfFc);
    		row++;
    		
    		//
    		beginTime="";
    		if(businessRequest.getAdvanTime()!=null){
    			beginTime=DateUtil.format(businessRequest.getAdvanTime(), "yyyy年MM月dd日");
    		}
    		endTime="";
    		if(businessRequest.getBegin()!=null){
    			endTime=DateUtil.format(businessRequest.getBegin(), "yyyy年MM月dd日");
    		}
    		
    		
    		writeLabel(sheet,row, "期户完成时间：",beginTime,"发起时间：",endTime,wcfFh,wcfFc);
    		row++;
    		
    		String tmp1="";
    		
    		if(businessRequest.getProdPerson()!=null){
    			tmp1=businessRequest.getProdPerson().getName();
    		}
    		
    		String tmp2="";
    		
    		if(businessRequest.getProdDept()!=null){
    			tmp2=businessRequest.getProdDept().getFullName();
    		}
    		
    		writeLabel(sheet,row, "产品经理：",tmp1,"产品部门：",tmp2,wcfFh,wcfFc);
    		row++;
    		
    		//
    		
    		writeLabel(sheet,row, "需求类别：",businessRequest.getType(),"重要性：",businessRequest.getImportance(),wcfFh,wcfFc);
    		row++;
    		
    		//
    		String content=StringUtils.replace(businessRequest.getContent(), "<br/>", "\n");
    		sheet.setRowView(row,1000);
    		//wcfFc.setWrap(true);
    		writeLabel(sheet,row,"内    容：",content,wcfFh,wcfFc);
    		row++;
    		
    		label = new Label(0, row, "附件：",wcfFh); 
    		sheet.addCell(label);
    		//row++;
    		
    		//
    		String gridLabArr[]=new String[]{"办理步骤","附件名称","附件类型","上传人员","上传时间"};
    		for (int i = 0; i < gridLabArr.length; i++) {
    			label = new Label(i+1, row, gridLabArr[i],wcfFcGrid); 
        		sheet.addCell(label);
			}
    		row++;
    		
    		//附件记录
    		for (ReqDocu reqDocu : reqDocuList) {
    			if(StringUtils.isNotBlank(reqDocu.getLength())){
    				int length=Integer.parseInt(reqDocu.getLength());
    				if(length>1){
    					sheet.mergeCells(1, row, 1, row+length);
    				}
    				
    				label = new Label(1, row, reqDocu.getProcessDetail().getName(),wcfFc); 
            		sheet.addCell(label);
    			}
    			
    			label = new Label(2, row, reqDocu.getFullName(),wcfFc);
        		sheet.addCell(label);
        		
        		label = new Label(3, row, reqDocu.getDocType().getName(),wcfFc); 
        		sheet.addCell(label);
        		
        		label = new Label(4, row, reqDocu.getCreator(),wcfFc); //
        		sheet.addCell(label);
        		
        		beginTime=DateUtil.format(reqDocu.getBegin(), "yyyy-MM-dd HH:mm");
        		label = new Label(5, row, beginTime,wcfFc); //
        		sheet.addCell(label);
    			row++;
    		}
    		//end
    		row++;
    		//分类三
    		sheet.mergeCells(0, row, 7, row);
    		label = new Label(0, row, "办理过程",wcfF); //
    		sheet.addCell(label);
    		row++;
    		
    		gridLabArr=new String[]{"序号","办理步骤","办理事项","办理意见","","办理人员","到达时间","办理时间"};
     		for (int i = 0; i < gridLabArr.length; i++) {
     			
     			label = new Label(i, row, gridLabArr[i],wcfFcGrid); //
         		sheet.addCell(label);
 			}
     		sheet.mergeCells(3, row, 4, row);
     		row++;
     		int i=1;
     		
     		for (ProcTranRecord task : list) {
     			setGridRec(sheet, wcfFc, row, i, task);
        		i++;
        		row++;
    		}
     		for (ProcTranRecord task : processInstView.getFlowTaskList()) {
     			setGridRec(sheet, wcfFc, row, i, task);
        		i++;
        		row++;
			}
     		
    		workbook.write();
    		workbook.close();
			//os.close();
        }catch (Exception e) {
			// TODO: handle exception
        	//e.printStackTrace();
		}
		return null;
    }
	private void setGridRec(WritableSheet sheet, jxl.write.WritableCellFormat wcfFc, int row, int i, ProcTranRecord task) throws WriteException, RowsExceededException {
		Label label;
		String beginTime;
		String endTime;
		label = new Label(0, row, String.valueOf(i),wcfFc); //
		sheet.addCell(label);
		
		label = new Label(1, row, task.getProcessStep().getName(),wcfFc); //
		sheet.addCell(label);
		
		label = new Label(2, row, task.getMatters(),wcfFc); //
		sheet.addCell(label);
		
		sheet.mergeCells(3, row, 4, row);
		label = new Label(3, row, StringUtils.replace(task.getTransactInfo(), "<br />", "\n"),wcfFc); //
		sheet.addCell(label);
		
		
		label = new Label(5, row, task.getTransactor().getName(),wcfFc); 
		sheet.addCell(label);
		
		beginTime=DateUtil.format(task.getReceiveTime(), "yyyy-MM-dd HH:mm");
		label = new Label(6, row, beginTime,wcfFc); //
		sheet.addCell(label);
		
		endTime="";
		if(task.getTransactTime()!=null){
			endTime=DateUtil.format(task.getTransactTime(), "yyyy-MM-dd HH:mm");
		}
		label = new Label(7, row, endTime,wcfFc); //
		sheet.addCell(label);
	}
	/**
	 * 由查看转向编辑页面
	 * 
	 * @return
	 */
	public String toChange() {
		initDict();
		// 取业务数据
		String procInstIdS = ApplicationContextUtil.getContextObject("procInstIdS");
		Integer procInstId = Integer.valueOf(procInstIdS);
		businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procInstId);
		businessRequest.replaceContentBRtoN();
		// 取得已经上传文档
		List<ReqDocu> reqDocuList = getAppBusinessReqService().getAppBusinessReqDao().findDocuList(procInstId);
		setRepDocTableStyleList(reqDocuList);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("reqDocuList", reqDocuList);
		// 取得流程实例及任务信息
		ProcessInstView processInstView = getProcessPvcService().getProcessInstView(procInstId);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("taskView", processInstView);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("procInstIdS", procInstId);
		return "toChange";
	}

	/**
	 * 提交编辑
	 * 
	 * @return
	 */
	public String change() {

		// 取业务数据
		String procInstIdS = ApplicationContextUtil.getContextObject("procInstIdS");
		Integer procInstId = Integer.valueOf(procInstIdS);
		BusinessRequest bsRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procInstId);
		bsRequest.setName(businessRequest.getName());
		bsRequest.setContent(businessRequest.getContent());
		bsRequest.setType(businessRequest.getType());
		bsRequest.setImportance(businessRequest.getImportance());
		bsRequest.setBusinessTag(businessRequest.getBusinessTag());
		bsRequest.replaceContentNtoBR();
		getAppBusinessReqService().getAppBusinessReqDao().save(bsRequest);
		this.returnMsg = "需求单数据编辑保存成功！";
		return JUMP_MSG;
	}

	/**
	 * 强制结束
	 * 
	 * @return
	 */
	public String toEnd() {
		String procInstIdS = ApplicationContextUtil.getContextObject("procInstIdS");
		Integer procInstId = Integer.valueOf(procInstIdS);
		getAppBusinessReqService().toEnd(procInstId, null);
		this.returnMsg = "已成功结束此需求单！";
		return JUMP_MSG;
	}

	/**
	 * 查看需求单管理按钮
	 * 
	 * @return
	 */
	public String toManage() {
		String procInstIdS = ApplicationContextUtil.getContextObject("procInstIdS");
		String bsType = ApplicationContextUtil.getHttpServletRequest().getParameter("bsType");
		Integer procinstId = Integer.valueOf(procInstIdS);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("procinstId", procinstId);
		ApplicationContextUtil.getHttpServletRequest().setAttribute("bsType", bsType);
		return "toManage";
	}

	/**
	 * 查看需求单管理按钮的提交
	 * 
	 * @return
	 */
	public String manage() {
		String procInstIdS = ApplicationContextUtil.getHttpServletRequest().getParameter("str_procinstId");
		Integer procInstId = Integer.valueOf(procInstIdS);
		String manageType = ApplicationContextUtil.getHttpServletRequest().getParameter("manageType");
		String bsType = ApplicationContextUtil.getHttpServletRequest().getParameter("bsType");
		String nowMan = ApplicationContextUtil.getHttpServletRequest().getParameter("nowMan");
		String reason = ApplicationContextUtil.getHttpServletRequest().getParameter("reason");
		BusinessReason businessReason = new BusinessReason();
		businessReason.setProcinstId(String.valueOf(procInstId));
		businessReason.setCreateTime(new Date());
		businessReason.setCreator(ApplicationContextUtil.getUserContextObject().getCurrUser().getPerson().getName());
		businessReason.setBsType(bsType);
		if ("delete".equals(manageType)) {

			businessReason.setCreateType("删除");
			businessReason.setCreateReason(reason);
			getAppBusinessReqService().delete(procInstId, bsType, businessReason);
			this.returnMsg = "已成功删除此需求单！";
		} else if ("end".equals(manageType)) {
			businessReason.setCreateType("结束");
			businessReason.setCreateReason(reason);
			getAppBusinessReqService().toEnd(procInstId, businessReason);
			this.returnMsg = "已成功结束此需求单！";
		} else if ("change".equals(manageType)) {
			// 变更当前办理人
			businessReason.setCreateType("变更办理人");
			businessReason.setCreateReason(reason);
			getAppBusinessReqService().changeTransactor(procInstId, nowMan, businessReason);
			this.returnMsg = "已成功变更当前办理人！";
		} else if ("businessTag".equals(manageType)) {
			// 编辑业务标签
			if ("1".equals(bsType)) {
				BusinessRequest businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(procInstId);
				businessRequest.setBusinessTag(reason);
				getAppBusinessReqService().getAppBusinessReqDao().save(businessRequest);
			} else {
				ProdAdvReq prodAdvReq = getAppBusinessReqService().getAppBusinessReqDao().getProdAdvReq(procInstId);
				prodAdvReq.setBusinessTag(reason);
				getAppBusinessReqService().getAppBusinessReqDao().save(prodAdvReq);
			}
			businessReason.setCreateType("编辑业务标签");
			reason = "编辑业务标签：" + reason;
			businessReason.setCreateReason(reason);
			getAppBusinessReqService().getAppBusinessReqDao().save(businessReason);
			this.returnMsg = "已成功编辑业务标签！";
		}

		return JUMP_MSG;
	}

	/**
	 * 删除需求单
	 * 
	 * @return
	 */
	public String toDelete() {
		String procInstIdS = ApplicationContextUtil.getContextObject("procInstIdS");
		Integer procInstId = Integer.valueOf(procInstIdS);
		getAppBusinessReqService().delete(procInstId, "1", null);
		this.returnMsg = "已成功删除此需求单！";
		return JUMP_MSG;
	}

	/**
	 * 保存数据提交任务 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String saveOrCommitTask() {
		String procinstId = ApplicationContextUtil.getContextObject("procinstId");
		String isCommitS = ApplicationContextUtil.getContextObject("isCommit");
		boolean isCommit = Boolean.valueOf(isCommitS);// 保存
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		List<TaskAssignBean> nextTasksList = getNextTaskUserList(req);
		String content = req.getParameter("commentComtent");
		setCommitTaskMsg(isCommit);
		try {
			// 保存业务数据
			String projectApply = ApplicationContextUtil.getContextObject("businessRequest.projectApply");
			if (StringUtils.isNotBlank(projectApply)) {
				BusinessRequest businessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(Integer.valueOf(procinstId));
				businessRequest.setProjectApply(projectApply);
				getAppBusinessReqService().getAppBusinessReqDao().save(businessRequest);
			}
			// end
			getAppBusinessReqService().saveDataAndCommitTask(flowTaskId, content, nextTasksList, isCommit, uploads, filetype, delDocumentIds);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			returnMsg = e.getMessage();
		}
		return JUMP_MSG;
	}

	/**
	 * 需求分析保存期望时间
	 * 
	 * @return
	 */
	public String saveBsReqAdvan() {
		String isCommitS = ApplicationContextUtil.getContextObject("isCommit");
		boolean isCommit = Boolean.valueOf(isCommitS);// 保存
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		List<TaskAssignBean> nextTasksList = getNextTaskUserList(req);
		String content = req.getParameter("commentComtent");
		setCommitTaskMsg(isCommit);
		BusinessRequest bsRequest = new BusinessRequest();
		String planTime = req.getParameter("businessRequest.planTime");
		bsRequest.setPlanTime(cn.ffcs.util.converter.DateUtil.strToDate(planTime, "yyyy-MM-dd"));
		try {
			getAppBusinessReqService().saveReqPlanAndCommitTask(flowTaskId, content, nextTasksList, isCommit, bsRequest, uploads, filetype, delDocumentIds);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			this.returnMsg = e.getMessage();
		}
		return JUMP_MSG;
	}

	/**
	 * 计划时间确认
	 * 
	 * @return
	 */
	public String saveConfirmPlan() {
		String isCommitS = ApplicationContextUtil.getContextObject("isCommit");
		boolean isCommit = Boolean.valueOf(isCommitS);// 保存
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		List<TaskAssignBean> nextTasksList = getNextTaskUserList(req);
		String content = req.getParameter("commentComtent");
		String confirmPlanCheck = req.getParameter("confirmPlanCheck");
		setCommitTaskMsg(isCommit);
		try {
			getAppBusinessReqService().saveConfirmPlanTask(flowTaskId, content, nextTasksList, isCommit, confirmPlanCheck, uploads, filetype, delDocumentIds);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			this.returnMsg = "对不起，操作失败！" + e.getMessage();
		}
		return JUMP_MSG;
	}

	/**
	 * 计划时间确认回退
	 * 
	 * @return
	 */
	public String rollConfirmPlan() {
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		String content = req.getParameter("commentComtent");
		// String confirmPlanCheck=req.getParameter("confirmPlanCheck");
		String confirmPlanCheck = "02";
		this.returnMsg = "待办单回退成功！";
		try {
			getAppBusinessReqService().rollConfirmPlanTask(flowTaskId, content, confirmPlanCheck);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			this.returnMsg = e.getMessage();
		}
		return JUMP_MSG;
	}

	/**
	 * 发起人修改保存数据 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String updateBROrCommitTask() {
		// 保存业务数据
		String advanTime = ApplicationContextUtil.getContextObject("businessRequest.advanTime");
		if (StringUtils.isNotBlank(advanTime)) {
			try {
				businessRequest.setAdvanTime(DateUtil.parse(advanTime, "yyyy-MM-dd"));
			} catch (ParseException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		}

		String procinstId = ApplicationContextUtil.getContextObject("procinstId");
		String isCommitS = ApplicationContextUtil.getContextObject("isCommit");
		boolean isCommit = Boolean.valueOf(isCommitS);// 保存
		HttpServletRequest req = ApplicationContextUtil.getHttpServletRequest();
		List<TaskAssignBean> nextTasksList = getNextTaskUserList(req);
		String content = req.getParameter("commentComtent");
		setCommitTaskMsg(isCommit);
		try {
			BusinessRequest newbusinessRequest = getAppBusinessReqService().getAppBusinessReqDao().getBusinessRequest(Integer.valueOf(procinstId));
			newbusinessRequest.setName(this.businessRequest.getName());
			newbusinessRequest.setContent(this.businessRequest.getContent());
			newbusinessRequest.setAdvanTime(this.businessRequest.getAdvanTime());
			if (this.businessRequest.getProdPerson() != null && this.businessRequest.getProdPerson().getId() != null) {
				newbusinessRequest.setProdPerson(this.businessRequest.getProdPerson());
				newbusinessRequest.setProdDept(getAppBusinessReqService().getOrgByPerson(this.businessRequest.getProdPerson()));
			}

			if (this.businessRequest.getStartPersonObj() != null && this.businessRequest.getStartPersonObj().getId() != null) {
				Person starPerson = getAppBusinessReqService().getAppBusinessReqDao().getPerson(this.businessRequest.getStartPersonObj().getId());
				newbusinessRequest.setStartPerson(starPerson.getName());
				newbusinessRequest.setStartPersonObj(starPerson);
				newbusinessRequest.setStartDeptObj(getAppBusinessReqService().getOrgByPerson(this.businessRequest.getStartPersonObj()));
				newbusinessRequest.setStartDept(newbusinessRequest.getStartDeptObj().getName());
			}

			newbusinessRequest.setImportance(this.businessRequest.getImportance());
			newbusinessRequest.setType(this.businessRequest.getType());
			businessRequest.replaceContentNtoBR();
			getAppBusinessReqService().saveAppDataAndCommitTask(flowTaskId, content, nextTasksList, isCommit, newbusinessRequest, uploads, filetype, delDocumentIds);
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
			returnMsg = e.getMessage();
		}
		return JUMP_MSG;
	}

	/**
	 * 查找待办任务列表 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String findRunTaskList() {
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		String isPerson = request.getParameter("isPerson");
		if (StringUtils.isBlank(isPerson)) {
			flowTaskForm.setUserId(ApplicationContextUtil.getUserContextObject().getCurrUser().getPerson().getId().toString());
		}
		List<String> listShortName = getAppBusinessReqService().getAppBusinessReqDao().getAllShortName();
		request.setAttribute("listShortName", listShortName);
		flowTaskForm.setState(TaskService.TASK_STATE_ACTIVE);
		PageBean pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageTaskList(flowTaskForm, PageNavUtil.getPageNo(request), PageNavUtil.getPageSize(request));
		request.setAttribute("tasklist", pageBean.getDataList());
		String pageNaviStr = PageNavi.getPageNaviText(request, pageBean);
		request.setAttribute("pageNaviStr", pageNaviStr);
		return "bsReqTaskList";
	}

	public String findOARunTaskList() {
		findRunTaskList();
		return "oaListBusinessRequest";
	}

	/**
	 * 查找已办任务列表 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String findHisTaskList() {
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		String isPerson = request.getParameter("isPerson");
		if (StringUtils.isBlank(isPerson)) {
			flowTaskForm.setUserId(ApplicationContextUtil.getUserContextObject().getCurrUser().getPerson().getId().toString());
		}

		flowTaskForm.setState(TaskService.TASK_STATE_END);
		PageBean pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageTaskList(flowTaskForm, PageNavUtil.getPageNo(request), PageNavUtil.getPageSize(request));
		request.setAttribute("tasklist", pageBean.getDataList());
		String pageNaviStr = PageNavi.getPageNaviText(request, pageBean);
		request.setAttribute("pageNaviStr", pageNaviStr);
		return "bsHisReqTaskList";
	}

	@SuppressWarnings("unchecked")
	private void setAppReqRunTask(HttpServletRequest request, PageBean pageBean) {
		List<BusinessRequest> list = pageBean.getDataList();
		Date curDate = new Date();
		Date end = null;
		Date adv = null;
		if (list != null && list.size() > 0) {
			for (BusinessRequest businessRequest : list) {
				if (businessRequest.getProcinstId() != null) {
					List<Node> nodeList = getTaskService().getFlowPvcDao().findRunNodeList(businessRequest.getProcinstId().toString());
					if (nodeList != null && nodeList.size() > 0) {
						String currStatus = "";
						for (Node node : nodeList) {
							currStatus += node.getName() + "、";
						}
						currStatus = currStatus.substring(0, currStatus.length() - 1);
						businessRequest.setCurrStatus(currStatus);
					} else {
						businessRequest.setCurrStatus("结束");
					}

				}
				// 对于需求单完成超期的判断start
				end = businessRequest.getActTime();
				adv = businessRequest.getPlanTime();
				if (end != null) {
					if (adv != null && end.after(adv)) {
						businessRequest.setIsValidDate("true");
					}
				} else {
					if (adv != null && curDate.after(adv)) {
						businessRequest.setIsValidDate("true");
					}
				}
				// System..println(businessRequest.getIsValidDate()+adv);
				// end
			}
		}
		request.setAttribute("bsReqlist", pageBean.getDataList());
		String pageNaviStr = PageNavi.getPageNaviText(request, pageBean);
		request.setAttribute("pageNaviStr", pageNaviStr);
	}

	/**
	 * 
	 * TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String findOAHisTaskList() {
		// findHisTaskList();

		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		flowTaskForm.setIsPerson("true");
		findHisAppReqList();

		return "oaListEventBusinessRequest";
	}

	/**
	 * 需求单导出，包括待办，已办，所有需求单
	 * 
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public String outAppList() {
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		HttpServletResponse response = ApplicationContextUtil.getHttpServletResponse();
		String type = request.getParameter("type");
		PageBean pageBean = null;
		List list = null;
		String name = "";
		if ("task".equals(type)) {
			flowTaskForm.setUserId(ApplicationContextUtil.getUserContextObject().getCurrUser().getPerson().getId().toString());
			flowTaskForm.setState(TaskService.TASK_STATE_ACTIVE);
			pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageTaskList(flowTaskForm, PageNavUtil.getPageNo(request), 10000);
			list = pageBean.getDataList();
			name = "待办单列表";
			return this.out(name, list, response);
		} else if ("true".equals(type)) {

			User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
			flowTaskForm.setUserId(user.getPerson().getId().toString());
			flowTaskForm.setState(TaskService.TASK_STATE_END);
			name = "已办单列表";
			pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageAllBsReqList(this.flowTaskForm, PageNavUtil.getPageNo(request), 10000);
			list = pageBean.getDataList();
			return this.out(name, list, response);
		} else if ("false".equals(type)) {
			name = "所有需求单";
			pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageAllBsReqList(this.flowTaskForm, PageNavUtil.getPageNo(request), 10000);
			setAppReqRunTask(request, pageBean);
			list = pageBean.getDataList();
			return this.out(name, list, response);

		}
		return null;
	}

	/**
	 * 导出
	 * 
	 * @param list
	 * @param response
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public String out(String name, List list, HttpServletResponse response) {
		try {
			// open file.
			// String load=request.getRealPath("tmp");
			response.setContentType("application/stream;charset=UTF-8");
			response.setHeader("Content-Disposition", "attachment; filename=\"" + URLEncoder.encode(name + ".xls", "UTF-8") + "\"");
			OutputStream os = response.getOutputStream();
			WritableWorkbook book = Workbook.createWorkbook(os);
			String[] headName = new String[] { "需求单号", "需求名称", "发起部门", "发起人", "当前状态", "产品经理", "发出时间", "业务标签" };
			int[] headNameCol = new int[] { 15, 60, 25, 15, 20, 15, 15, 15 };
			WritableSheet sheet = book.createSheet("Sheet_1", 0);
			sheet.setColumnView(0, 400);
			for (int i = 0; i < headName.length; i++) {
				Label label = new Label(i, 0, headName[i]);
				sheet.addCell(label);
				sheet.setColumnView(i, headNameCol[i]);
			}

			Label label = null;
			Date date = null;
			BusinessRequest bsRequest = null;
			FlowTaskObjView flowTaskObjView = null;
			if (list != null && list.size() != 0) {
				for (int i = 0; i < list.size(); i++) {
					int j = 0;
					if (name.equals("待办单列表")) {
						flowTaskObjView = (FlowTaskObjView) list.get(i);
						label = new Label(j++, i + 1, flowTaskObjView.getReqCode());
						sheet.addCell(label);
						label = new Label(j++, i + 1, flowTaskObjView.getTitle());
						sheet.addCell(label);
						label = new Label(j++, i + 1, flowTaskObjView.getShortName());
						sheet.addCell(label);
						label = new Label(j++, i + 1, flowTaskObjView.getStartPerson());
						sheet.addCell(label);
						label = new Label(j++, i + 1, flowTaskObjView.getFlowName());
						sheet.addCell(label);
						label = new Label(j++, i + 1, flowTaskObjView.getProdPerson());
						sheet.addCell(label);
						date = flowTaskObjView.getStartTime();
						if (date == null) {
							label = new Label(j++, i + 1, "");
							sheet.addCell(label);
						} else {
							label = new Label(j++, i + 1, cn.ffcs.util.converter.DateUtil.dateToStr(date, "yyyy-MM-dd"));
							sheet.addCell(label);
						}
						label = new Label(j++, i + 1, flowTaskObjView.getBusinessTag());
						sheet.addCell(label);
					} else {
						bsRequest = (BusinessRequest) list.get(i);
						label = new Label(j++, i + 1, bsRequest.getReqCode());
						sheet.addCell(label);
						label = new Label(j++, i + 1, bsRequest.getName());
						sheet.addCell(label);
						label = new Label(j++, i + 1, bsRequest.getStartDept());
						sheet.addCell(label);
						label = new Label(j++, i + 1, bsRequest.getStartPerson());
						sheet.addCell(label);
						label = new Label(j++, i + 1, bsRequest.getCurrStatus());
						sheet.addCell(label);
						label = new Label(j++, i + 1, bsRequest.getProdPerson().getName());
						sheet.addCell(label);
						date = bsRequest.getBegin();
						if (date == null) {
							label = new Label(j++, i + 1, "");
							sheet.addCell(label);
						} else {
							label = new Label(j++, i + 1, cn.ffcs.util.converter.DateUtil.dateToStr(date, "yyyy-MM-dd"));
							sheet.addCell(label);
						}
						label = new Label(j++, i + 1, bsRequest.getBusinessTag());
						sheet.addCell(label);
					}
				}
			}
			book.write();
			book.close();
			os.close();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	/**
	 * 查看所有或已办的需求单
	 * 
	 * @return
	 */
	public String findHisAppReqList() {
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		String isPerson = request.getParameter("flowTaskForm.isPerson");
		if ("true".equalsIgnoreCase(isPerson)) {
			flowTaskForm.setIsPerson("true");
		} else {

		}
		if ("true".equalsIgnoreCase(flowTaskForm.getIsPerson())) {
			User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
			flowTaskForm.setUserId(user.getPerson().getId().toString());

		}
		List<String> listShortName = getAppBusinessReqService().getAppBusinessReqDao().getAllShortName();
		request.setAttribute("listShortName", listShortName);
		PageBean pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageAllBsReqList(this.flowTaskForm, PageNavUtil.getPageNo(request), PageNavUtil.getPageSize(request));
		setAppReqRunTask(request, pageBean);
		return "bsReqAppHisList";
	}

	public String searchPersonBsReqList() {
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
		flowTaskForm.setUserId(user.getPerson().getId().toString());
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		request.setAttribute("selectItemMenu", "iTR2");
		return searchBsReqList();
	}

	public String searchBsReqList() {
		if (flowTaskForm == null) {
			flowTaskForm = new FlowTaskForm();
		}
		User user = ApplicationContextUtil.getUserContextObject().getCurrUser();
		flowTaskForm.setUserId(user.getPerson().getId().toString());
		flowTaskForm.setProcinstType("01");
		return searchBsReqListCondition();
	}

	public String searchBsReqListCondition() {
		HttpServletRequest request = ApplicationContextUtil.getHttpServletRequest();
		PageBean pageBean = getAppBusinessReqService().getAppBusinessReqDao().queryPageBsReqList(this.flowTaskForm, PageNavUtil.getPageNo(request), PageNavUtil.getPageSize(request));
		setAppReqRunTask(request, pageBean);
		return "bsReqAppList";
	}

	/**
	 * 转向进展信息填写页面 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String toDoProcess() {

		return "toDoProcess";
	}

	/**
	 * 保存进展信息 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String saveDoProcess() {
		User currUser = ApplicationContextUtil.getUserContextObject().getCurrUser();
		reqProgress.setCreateTime(new Date());
		reqProgress.setCreator(currUser.getCreator());
		reqProgress.setRequestBusiness(businessRequest);
		reqProgress.setRecotdId(flowTaskId);
		getAppBusinessReqService().saveDoProcess(reqProgress);
		this.returnMsg = "填写进展信息保存成功";
		return JUMP_MSG;
	}

	/**
	 * 保存延迟信息 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String saveDoDelay() {
		User currUser = ApplicationContextUtil.getUserContextObject().getCurrUser();
		reqDelay.setCreateTime(new Date());
		reqDelay.setCreator(currUser.getCreator());
		reqDelay.setRequestBusiness(businessRequest);
		reqDelay.setRecotdId(flowTaskId);
		getAppBusinessReqService().saveDoDelay(reqDelay);
		this.returnMsg = "申请延迟信息保存成功";
		return JUMP_MSG;
	}

	/**
	 * 转向进展延迟信息界面 TODO 请输入方法说明
	 * 
	 * @return
	 */
	public String toDoDelay() {
		return "toDoDelay";
	}

	public String applyRequest() {
		return SUCCESS;
	}

	public String findTaskFormData() {
		return SUCCESS;
	}

	private void initDict() {
		String reqNewProdtypes = "REQ_NEW_PROD_TYPE";
		String reqImportType = "REQ_IMPORT_TYPE";
		initDict(reqNewProdtypes,reqImportType);

	}

	private void initReqDict() {
		String reqNewProdtypes = "REQ_PROD_TYPE";
        String reqImportType = "REQ_IMPORT_TYPE";
		initDict(reqNewProdtypes,reqImportType);

	}
	
	private void initDict(String typeName,String importName){        
        types=getAppBusinessReqService().getAppBusinessReqDao().findDict(typeName);        
        importances=getAppBusinessReqService().getAppBusinessReqDao().findDict(importName);
    }
	
	public ProcessPvcService getProcessPvcService() {
		return processPvcService;
	}

	public void setProcessPvcService(ProcessPvcService processPvcService) {
		this.processPvcService = processPvcService;
	}

	public TaskService getTaskService() {
		return taskService;
	}

	public void setTaskService(TaskService taskService) {
		this.taskService = taskService;
	}

	public BusinessRequest getBusinessRequest() {
		return businessRequest;
	}

	public void setBusinessRequest(BusinessRequest businessRequest) {
		this.businessRequest = businessRequest;
	}

	public AppBusinessReqService getAppBusinessReqService() {
		return appBusinessReqService;
	}

	public void setAppBusinessReqService(AppBusinessReqService appBusinessReqService) {
		this.appBusinessReqService = appBusinessReqService;
	}

	public List<Dict> getTypes() {
		return types;
	}

	public void setTypes(List<Dict> types) {
		this.types = types;
	}

	public List<Dict> getImportances() {
		return importances;
	}

	public void setImportances(List<Dict> importances) {
		this.importances = importances;
	}

	public List<String> getFiletype() {
		return filetype;
	}

	public void setFiletype(List<String> filetype) {
		this.filetype = filetype;
	}

	public List<File> getUploads() {
		return uploads;
	}

	public void setUploads(List<File> uploads) {
		this.uploads = uploads;
	}

	public String getProcessId() {
		return processId;
	}

	public void setProcessId(String processId) {
		this.processId = processId;
	}

	public String getFlowTaskId() {
		return flowTaskId;
	}

	public void setFlowTaskId(String flowTaskId) {
		this.flowTaskId = flowTaskId;
	}

	public List<String> getDelDocumentIds() {
		return delDocumentIds;
	}

	public void setDelDocumentIds(List<String> delDocumentIds) {
		this.delDocumentIds = delDocumentIds;
	}

	public ConfigBean getConfigBean() {
		return configBean;
	}

	public void setConfigBean(ConfigBean configBean) {
		this.configBean = configBean;
	}

	public ReqProgress getReqProgress() {
		return reqProgress;
	}

	public void setReqProgress(ReqProgress reqProgress) {
		this.reqProgress = reqProgress;
	}

	public ReqDelay getReqDelay() {
		return reqDelay;
	}

	public void setReqDelay(ReqDelay reqDelay) {
		this.reqDelay = reqDelay;
	}

	public ProdAdvReq getProdAdvReq() {
		return prodAdvReq;
	}

	public void setProdAdvReq(ProdAdvReq prodAdvReq) {
		this.prodAdvReq = prodAdvReq;
	}

	public FlowTaskForm getFlowTaskForm() {
		return flowTaskForm;
	}

	public void setFlowTaskForm(FlowTaskForm flowTaskForm) {
		this.flowTaskForm = flowTaskForm;
	}

	public Integer getProcinstId() {
		return procinstId;
	}

	public void setProcinstId(Integer procinstId) {
		this.procinstId = procinstId;
	}

	public String getStr_procinstId() {
		return str_procinstId;
	}

	public void setStr_procinstId(String str_procinstId) {
		this.str_procinstId = str_procinstId;
	}

}
